(function () {
  var b = getServerHost(),
    d = function () {
      var k = location.search,
        l = {};
      if (-1 != k.indexOf("?")) {
        var m = k.substr(1);
        strs = m.split("&");
        for (var n = 0; n < strs.length; n++) 
          l[strs[n].split("=")[0]] = decodeURIComponent(strs[n].split("=")[1])
      }
      return l
    }()
      .openId,
    e = window.location.href;
  wx.ready(function () {
    var k = "翻卡牌赢U盘/500MB，父亲节福利送不停！",
      desc = '拼手气&人气的时候到啦~',
      desct = '拼手气&人气的时候到啦~',
      o = "http://wxsd1.unisk.cn/freet/weixin/toshare",
      p = "http://wxsd1.unisk.cn/staticPages/FreeT/freetcard/img/tinified/card-back.png";
    wx.onMenuShareTimeline({
      title: k,
      desc: desc,
      link: o,
      imgUrl: p,
      success: function success() {
        $("#share").hide(),
        $.ajax({
          url: getServerHost() + "ruffleCard/toShare",
          dataType: "json",
          data: {
            openId: d
          },
          success: function success() {
            location.href = "http://wx1.unisk.cn/weixinLinksucaiController.do?link&id=ff808081630221220163fcf" +
                "cbe9e3efe&jwid=gh_fc380688dfba"
          },
          error: function error() {
            j = "error"
          }
        })
      },
      cancel: function cancel() {}
    }),
    wx.onMenuShareAppMessage({
      title: k,
      desc: desct,
      link: o,
      imgUrl: p,
      type: "link",
      dataUrl: "",
      success: function success() {
        $("#share").hide(),
        $.ajax({
          url: getServerHost() + "ruffleCard/toShare",
          dataType: "json",
          data: {
            openId: d
          },
          success: function success() {
            location.href = "http://wx1.unisk.cn/weixinLinksucaiController.do?link&id=ff808081630221220163fcf" +
                "cbe9e3efe&jwid=gh_fc380688dfba"
          },
          error: function error() {}
        })
      },
      cancel: function cancel() {
        alert("\u5DF2\u53D6\u6D88")
      }
    })
  });
  var g = "oDxlNmsjqvV9D29r",
    h = "1420942347",
    j = null;
  $.ajax({
    url: getServerHost() + "weixin/getSignature",
    async: !1,
    dataType: "json",
    data: {
      nonceStr: g,
      timestamp: h,
      url: e
    },
    success: function success(k) {
      j = k.signature
    },
    error: function error() {
      j = "error"
    }
  }),
  wx.config({
    debug: 0,
    appId: "wx3de17fbd7be47063",
    timestamp: h,
    nonceStr: g,
    signature: j,
    jsApiList: [
      "checkJsApi",
      "onMenuShareTimeline",
      "onMenuShareAppMessage",
      "onMenuShareQQ",
      "onMenuShareWeibo",
      "hideMenuItems",
      "showMenuItems",
      "hideAllNonBaseMenuItem",
      "showAllNonBaseMenuItem",
      "translateVoice",
      "startRecord",
      "stopRecord",
      "onRecordEnd",
      "playVoice",
      "pauseVoice",
      "stopVoice",
      "uploadVoice",
      "downloadVoice",
      "chooseImage",
      "previewImage",
      "uploadImage",
      "downloadImage",
      "getNetworkType",
      "openLocation",
      "getLocation",
      "hideOptionMenu",
      "showOptionMenu",
      "closeWindow",
      "scanQRCode",
      "chooseWXPay",
      "openProductSpecificView",
      "addCard",
      "chooseCard",
      "openCard"
    ]
  })
})();